﻿<?php
class Company_indexAction extends GlobalAction
{
   
   public function _initialize(){
	parent::_initialize();	
   }
   
    public function index()
    {
	Load('extend');	
	parent::pub_left();
	//公司头条
	$news_first = M('company_news')->where('company_id='.$this->company_id)->order('add_date desc')->find();
	$this->assign('news_first',$news_first);
	//推荐商品 
	$rec_product = M('products')->where('company_id='.$this->company_id)->order('w_tuijian desc')->limit(10)->select();
	foreach($rec_product as $k=>$v){
		if($v['pro_pic'] == '')
		{
		$rec_product[$k]['pic_one'] = '__TMPL__/images/zhanwei.jpg';
		}
		else
		{
		$arr = explode(',',$v['pro_pic']);
		$rec_product[$k]['pic_one'] = $arr[0];	
		}
		}
	$this->assign('rec_product',$rec_product);
	//公司图片
	$rec_pic = M('company_pic')->where('company_id='.$this->company_id)->order('id desc')->limit(5)->select();
	$this->assign('rec_pic',$rec_pic);
	
    $this->display();
    }
	
	public function verify() {  
            import("ORG.Util.Image");  
            Image::buildImageVerify(4);  
    }  
	

}
?>